let type,no;

import {DataAnalyze_getStore,DataAnalyze_getStoreGroup,DataAnalyze_getStoreBin} from "./DataAnalyze";

export const DataShow=(_type,_no)=>{
  let htmltext="";
  type=_type;
  no=_no;
  if (type==="StoreSign"||type==="Store"){
    let store = DataAnalyze_getStore(no);
    htmltext='<p>仓库编码：'+store.no +'</p>';
    htmltext+='<p>仓库名称：'+store.store_name +'</p>';
    // htmltext+='<p>总库存：'+dataAnalyze.getStoreTotalBin(this.no) +'</p>';
    // htmltext+='<p>已占库存：'+dataAnalyze.getStoreOccurpyBin(this.no) +'</p>';
    // htmltext+='<p>今日入库：'+dataAnalyze.getStoreTotalBin(this.no) +'</p>';
    // htmltext+='<p>今日出库：'+dataAnalyze.getStoreOccurpyBin(this.no) +'</p>';
    htmltext+='<p1>提示：双击可查看详细信息</p1>';
  }else if (type==="StoreGroup"){
    let group = DataAnalyze_getStoreGroup(no);
    htmltext='<p>编码：'+group.no +'</p>';
    htmltext+='<p>名称：'+group.group_name +'</p>';
    // htmltext+='<p>总库存：'+dataAnalyze.getGroupTotalBin(this.no) +'</p>';
    // htmltext+='<p>已占库存：'+dataAnalyze.getGroupOccurpyBin(this.no) +'</p>';
    // htmltext+='<p>今日入库：'+dataAnalyze.getGroupTotalBin(this.no) +'</p>';
    // htmltext+='<p>今日出库：'+dataAnalyze.getGroupOccurpyBin(this.no) +'</p>';
    htmltext+='<p1>提示：双击可查看详细信息</p1>';
  }else if (type==="StoreGoods"){
    let bin = DataAnalyze_getStoreBin(no);
    htmltext='<p>编码：'+bin.no +'</p>';
    htmltext+='<p>名称：'+bin.bin_name +'</p>';
    htmltext+='<p>条码号：'+bin.barcode +'</p>';
    htmltext+='<p>状态：'+bin.state +'</p>';
  }
  return htmltext;
}

export const GetData=(_type,_no)=>{
  type=_type;
  no=_no;
  if (type==="StoreSign"||type==="Store"){
    let store = DataAnalyze_getStore(no);
    return store;
  }else if (type==="StoreGroup"){
    let group = DataAnalyze_getStoreGroup(no);
    return group;
  }else if (type==="StoreGoods"){
    let bin = DataAnalyze_getStoreBin(no);
    return bin;
  }
}
